1. Field of the Invention
Embodiments of the present invention relate generally to computer graphics and more specifically to techniques for projecting data sets between high-resolution and low-resolution objects.
2. Description of the Related Art
When building a three-dimensional (3D) character or model (also referred to as an “object”) for an application such as video games, developers continually contend with the tradeoff between image quality and performance. On one hand, developers want to add as much detail as possible to the 3D character or model to make it appear as life-like as possible. On the other hand, adding detail by increasing the number of polygons (e.g., triangles) making up the 3D character or model and/or applying high resolution bitmaps to the 3D character or model increases the amount of data used to represent the 3D character or model. With more data, more computation time is generally required to process the 3D character or model, which may negatively impact an application like a video game where “real time” graphics and interactivity enhance the overall user experience.
Typically, techniques such as “normal mapping” and “bump mapping” are used to address the tension between image quality and performance. As is well-known, these techniques entail transferring a data set, such as a set of surface normals, from a high-resolution object to a low-resolution object. With the high-resolution data set, shading detail can be added to the low-resolution object to give it a higher-resolution appearance without increasing the number of polygons making up the low-resolution object.
A projection cage is the traditional mechanism for transferring a data set between a high-resolution object and a low-resolution object. In sum, once the high-resolution object and the low-resolution object are aligned, the projection cage is expanded from the low-resolution object to encompass both the low-resolution object and the high-resolution object. A software engine is configured to then transfer the data set from the high-resolution object to the low-resolution object. After the data set is transferred, a two-dimensional bitmap (i.e., texture map) may be rendered that includes texture information from the low-resolution object as well as the high-resolution data set. This bitmap may then be saved and applied to any similar low-resolution object in a video game or other application whenever a higher-resolution appearance is desired.
One drawback to using a projection cage is that with complex low-resolution geometries, when the projection cage is expanded, a face of the projection cage may intersect a high-resolution object being “mapped” onto the low-resolution object or intersect a face of the low-resolution object. Another problem is that part of the projection cage may encompass a high-resolution object that is not being “mapped” onto the portion of the low-resolution model associated with that part of the projection cage. In other words, part of the projection cage volume may intersect the wrong high-resolution object. These phenomena (also referred to herein as “undesirable cage intersections”) compromise the software engine's ability to accurately transfer data sets between high-resolution and low-resolution objects. An example of these problems is set forth in FIG. 1A, which conceptually illustrates the transfer of data sets from a high-resolution ring 120 and a high-resolution ring 122 to a low resolution object 100 consisting of a finger 102 and a finger 104. As shown, the data set from the ring 120 is transferred to finger 102, and the data set from ring 122 is transferred to finger 104. Once ring 120 is aligned with finger 102 and ring 122 is aligned with finger 104, a projection cage 106 is expanded from finger 102 to encompass both finger 102 and ring 120 and from finger 104 to encompass both finger 104 and ring 122. Because there is limited space between finger 102 and finger 104, a portion 108 of projection cage 106 associated with finger 102 intersects finger 104 at a location 116. Further, portion 108 intersects ring 122, which is the high-resolution object being “mapped” onto finger 104, at a location 113. Similarly, a portion 110 of projection cage 106 associated with finger 104 intersects finger 102 at a location 112 and intersects ring 120, which is the high-resolution object being “mapped” onto finger 102, at a location 114. Again, these intersections compromise the ability of the software engine to accurately transfer the data sets from ring 120 and ring 122 to finger 102 and finger 104, respectively.
The current solution to these problems is for the developer to manually adjust or manipulate the projection cage to do away with all undesirable cage intersections. FIG. 1B illustrates the configuration of projection cage 106 after such manual adjustment. As shown, portion 108 no longer intersects the 122 or finger 104, and portion 110 no longer intersects ring 120 or finger 102. Manually adjusting a projection cage in this fashion usually is a tedious and time consuming process. Further, in some instances, the projection cage cannot be adjusted to avoid undesirable cage intersections. For example, if portion 108 of projection cage 106 consisted of only one long polygon, then there would not be enough vertices to manually adjust portion 108 to avoid finger 104 or ring 122.
As the foregoing illustrates, what is needed in the art is a way to transfer a data set using a projection cage that avoids the problems arising from undesirable cage intersections described above.